from django.db import models

# Create your models here.

class Card(models.Model):
    title = models.TextField(default='null')
    description = models.TextField(default='null')
    complexity = models.CharField(max_length=5)
    popularity = models.CharField(max_length=5)
    kind = models.TextField(default='null')

class User(models.Model):
    name = models.CharField(max_length=50)
    level = models.IntegerField(default=0)
    gold = models.IntegerField(default=0)
    last_login = models.CharField(max_length=14,default='20190131235959')

class Comment(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    card = models.ForeignKey(Card, on_delete=models.CASCADE)
    context = models.TextField(default='null')
    kind = models.TextField(default='null')
    p = models.IntegerField(default=0)
    t = models.IntegerField(default=0)

class Deck(models.Model):
    title = models.CharField(max_length=30,default='null')
    description = models.TextField(default='null')
    cards = models.TextField(default='null')

class LearnPlan(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    plan = models.TextField(default='null')

